/**
 * Created by zycool on 2016/8/31.
 * 登录
 */

;(function ($, window, document, undefined) {

    var map = document.getElementById('map');
    var map_url = DyyBase.root_path + '/static/flash/china.swf';
    window.loadMap = function (tag) {
        if(tag && map_url){
            if(flash_map.loadChinaMap){
                console.log(1111111);
                flash_map.loadChinaMap(map_url);
            }
        }
    };


    window.doLogin = function (data) {
        var url = DyyBase.root_path + '/login.html';
        var map = document.getElementById('map');
        DyyBase.ajax(url, {username: data.accout, pwd: data.password}, function (dataset) {
            if (dataset) {
                dataset = $.parseJSON(dataset);
                if (dataset.bool) {
                    alert('ok');
                } else {
                    if (map.getLogin) {
                        map.getLogin(dataset.result);
                    }
                }
            }
        });
    };

})($, window, document);
